package com.lzt.test

import com.lzt.app.HbaseTemplate

object TestHbase {

  def main(args: Array[String]): Unit = {
    testJson()
  }

  def testJson() ={
    import org.json4s._
    import org.json4s.JsonDSL._
    import org.json4s.jackson.JsonMethods._
    import HbaseTemplate.convertJson
    val result = HbaseTemplate.scan[JValue]("tccgl_ping", "201807111801", "201807111802")
    println(s"result : ${result.length}")
    result.foreach(x => println(compact(x)))
    val json = compact(render(("array" -> result)))
    println(json)
  }

  def testMap() = {
    import HbaseTemplate.convertMap
    val result = HbaseTemplate.scan[Map[String, String]]("tccgl_ping", "20180710", "20180720")
    println(s"result : ${result.length}")
    result.foreach(println)
  }
}
